﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Common.Library;
using OnlineVideos.Data;
using System.Threading.Tasks;
using OnlineVideos.Entities;

namespace OnlineVideos.Views
{
    public partial class DetailsBrowserPage : PhoneApplicationPage
    {
        public DetailsBrowserPage()
        {
            InitializeComponent();
            Loaded += DetailsBrowserPage_Loaded;
        }

        void DetailsBrowserPage_Loaded(object sender, RoutedEventArgs e)
        {

            var info = Task.Run(async()=>await Constants.connection.Table<WebInformation>().Where(i => i.ShowID == AppSettings.ShowUniqueID).FirstOrDefaultAsync()).Result;
            webBrowser1.NavigateToString(info.BeforeText + info.SelectedText + info.AfterText);
        }
    }
}